package cz.zcu.fav.rat.rest.factory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cz.zcu.fav.rat.dataaccess.service.SettingsFactory;
import cz.zcu.fav.rat.rest.beans.PropertiesMapping;

@Component
public class PropertiesMappingFactory
{
	@Autowired
	SettingsFactory settingsFactory;

	public PropertiesMapping getPropertiesMapping()
	{
		PropertiesMapping mapping = new PropertiesMapping();

		mapping.setMaximumDuration(settingsFactory
				.getMaximumReservationDuration().getStandardMinutes());
		mapping.setMinimumDuration(settingsFactory
				.getMinimumReservationDuration().getStandardMinutes());
		mapping.setMaximumPeriodsCount(settingsFactory
				.getMaximumPeriodicalCount());
		return mapping;
	}
}
